
<template>
  <el-dialog v-el-drag-dialog :append-to-body="opt.appendtobody" :close-on-click-modal="false" :title="opt.title"
    :visible.sync="isShow" v-if="isShow" @close="cancel()" :width="opt.width" :custom-class="opt.dclass">
    <component :is="view" :params="params" ref="viewobj"></component>
    <div style="margin-top:5px;text-align:right;margin-right:5px;">
      <button v-if="opt.confirmBtnText" type="button" class="el-button el-button--default el-button--small"
        @click="confirm()">
        <span>
          {{ opt.confirmBtnText }}
        </span>
      </button>
      <button v-if="opt.cancelBtnText" type="button"
        class="el-button el-button--default el-button--small el-button--primary " @click="cancel()">
        <span>
          {{ opt.cancelBtnText }}
        </span>
      </button>
    </div>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      isShow: true,
      opt: {
        appendtobody: false,
        title: "提示",
        confirmBtnText: "确定",
        cancelBtnText: "取消",
        width: "880px",
      },
      view: "",
      params: {},
    };
  },
  methods: {
    cancel() { },
    confirm() { },
  },
};
</script>
